# $Id: PKGBUILD 86885 2013-03-23 23:10:48Z td123 $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Alexsandr Pavlov <kidoz at mail dot ru>

pkgname=ruby-rack
pkgver=1.5.2
pkgrel=2
pkgdesc="Rack provides minimal, modular and adaptable interface for developing web applications in Ruby"
arch=(any)
#url="http://rack.rubyforge.org/"
url="http://rubyforge.org/projects/rack/"
license=('MIT')
depends=('ruby' 'rubygems')
noextract=("rack-$pkgver.gem")
source=(http://gems.rubyforge.org/gems/rack-$pkgver.gem)
md5sums=('02067ea717f5d2e4b8e0bcd5155fcbc5')

package() {
  cd $srcdir
  export HOME=/tmp
  local _gemdir="$(ruby -rubygems -e'puts Gem.default_dir')"
  gem install --no-user-install --ignore-dependencies -i "$pkgdir$_gemdir" -n "$pkgdir/usr/bin" rack-$pkgver.gem
  mkdir -p $pkgdir/usr/share/licenses/ruby-rack
  ln -s `find $pkgdir/usr/lib/ruby/ -type f -name COPYING | sed "s|$pkgdir||"` $pkgdir/usr/share/licenses/ruby-rack/COPYING
}
